package com.sgb.kjwl.api.service;

import com.sgb.kjwl.model.entity.BannerEntity;
import com.sgb.kjwl.model.entity.DeviceAttrEntity;
import com.sgb.kjwl.model.entity.DeviceDetailEntity;
import com.sgb.kjwl.model.entity.DeviceEntity;
import com.sgb.kjwl.model.entity.DeviceOutEntity;
import com.sgb.jicai.entity.FilterEntity;
import com.swgk.core.view.entity.MenuEntity;
import com.sgb.kjwl.model.entity.ParentAreaEntity;
import com.sgb.kjwl.model.entity.supplier3.DictEntity3;
import com.sgb.kjwl.model.entity.user.AddDeviceEntity;
import com.sgb.kjwl.model.entity.user.DeviceStateEntity;
import com.swgk.core.base.model.entity.ListResponse;
import com.swgk.core.base.model.entity.BaseEntity;
import com.swgk.core.base.model.factory.BaseUrlInterceptor;

import java.util.List;
import java.util.Map;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface DeviceAPI {

    //设备页面banner
    @FormUrlEncoded
    @POST("v1/app/equipment/bannerList")
    Call<BaseEntity<List<BannerEntity>>> getBannerList(@Field("areaCode") String areaCode);

    //设备页面分类列表
    @FormUrlEncoded
    @POST("v1/app/equipment/categoryList")
    Call<BaseEntity<List<MenuEntity>>> getCategoryList(@Field("areaCode") String areaCode);

    //设备页面出租列表
    @FormUrlEncoded
    @POST("v1/app/equipment/rentList")
    Call<BaseEntity<List<DeviceEntity>>> getRentList(@Field("areaCode") String areaCode);

    //设备检索热词
    @POST("v1/app/equipment/hotWord")
    Call<BaseEntity<List<String>>> getHotWord();

    //设备出租详情
    @FormUrlEncoded
    @POST("v1/app/equipment/detail")
    Call<BaseEntity<DeviceDetailEntity>> getDeviceOutDetail(@Field("id") String id);

    //设备出租详情中的参数
    @FormUrlEncoded
    @POST("v1/app/equipment/attr")
    Call<BaseEntity<List<DeviceAttrEntity>>> getDeviceOutAttr(@Field("id") String id);

    //设备出租列表
    @POST("v1/app/equipment/equipmentListV1")
    Call<BaseEntity<ListResponse<List<DeviceOutEntity>>>> getEquipmentListV1(@Body Map map);

    //设备出租地址列表
    @FormUrlEncoded
    @POST("v1/app/common/getAreaSecondAndThird")
    Call<BaseEntity<List<ParentAreaEntity<List<ParentAreaEntity>>>>> getAreaSecondAndThird(@Field("areaCode") String areaCode);

    //设备出租筛选一二级列表
    @POST("v1/app/equipment/categoryListV1")
    Call<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getCategoryListV1();

    //设备出租筛选三级列表
    @FormUrlEncoded
    @POST("v1/app/equipment/categoryAttributteV1")
    Call<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getCategoryAttributteV1(@Field("no") String no);

    //新增设备
    //@POST("v1/app/equipmentRent/addOrUpdate")
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL,"tokenType:pc"})
    @POST("v1/app/equimentRent/addOrUpdate")
    Call<BaseEntity> addDevice(@Body AddDeviceEntity entity);

    //设备详情
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL,"tokenType:pc"})
    @GET("v1/app/equipmentRent/getDetail")
    Call<BaseEntity<AddDeviceEntity>> getDeviceDetail(@Query("no") String no);

    //设备分享详情专用
    @Headers({BaseUrlInterceptor.HEADERS_URL_ZL,"tokenType:pc"})
    @GET("v1/app/equiment/getDetail")
    Call<BaseEntity<AddDeviceEntity>> getDeviceDetailShare(@Query("no") String no);

//    //机械/设备 发布时获取属性列表(categoryType:1为机械2为设备,firstCategoryNo:一级分类,secondCategoryNo:二级分类)
//    @POST("v1/app/leasepublic/getAttributeList")
//    Call<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getAttributeList(@Body Map map);
//    //编辑设备
//    @POST("v1/app/equipmentRent/update")
//    Call<BaseEntity> updateDevice(@Body AddDeviceEntity entity);

    //获取出租设备列表
    @GET("v1/app/equipmentRent/myList")
    Call<BaseEntity<ListResponse<List<DeviceStateEntity>>>> getPublishDevice(@Query("page") int page, @Query("limit") int size, @Query("status") String status/*,@Query("identity") String identity*/);

    //设备删除
    @POST("v1/app/equipmentRent/delete")
    Call<BaseEntity> delDeviceList(@Body Map map);

    //出租设备上下架
    @POST("v1/app/equipmentRent/putOut")
    Call<BaseEntity> deviceOnlineOrOff(@Body Map map);


    //获取设备分类
    @POST("v1/app/equipment/equipmentFirstCategory")
    Call<BaseEntity<List<DictEntity3>>> getDeviceFilterType();

}
